! This the manifest file for the Parchment in-browser interpreter, and gives
! the necessary details to Inform's release component (called cBlorb) so that
! the interpreter can be bundled into a released website, all set up ready
! to play the IF story file being released.

! Manifest files have a simple format. They are allowed to set the value of
! any cBlorb placeholders that they would like to, but the ones below are the
! only ones they will likely want to set. These two are needed for the footer
! of the play page:

[INTERPRETERVERSION]
Vorple
[]

[INTERPRETERURL]
http://vorple-if.com
[]

! Note that we don't set [INTERPRETER]: cBlorb has already set that to the
! name of the interpreter, in this case, to "Vorple".

! This declares whether the interpreter can handle blorbed Z-machine files
! ("z"), blorbed Glulx files ("g") or both ("zg" or "gz"). No other values
! are legal; note lower case.

[INTERPRETERVM]
g
[]

! [INTERPRETERHEAD] provides code to go into the <head> ... </head> of the
! web page playing the work. (Placeholder text starts on the line after the
! name, and continues until a line reads just []. Line breaks are included
! between lines, though not at the end of the final line; white space is
! stripped out at the left and right hand edges of each line.)

! In writing the head and body, note that the structure of the site being
! constructed is:
!     play.html  <-- page on which the interpreter runs
!     interpreter
!         ...the base64-encoded story file...
!         ...any files copied over according to the manifest below...
! The placeholder [ENCODEDSTORYFILE] expands to the leafname of the base64
! version of the story file, which might be (but should not be assumed
! to be) "story.zblorb.js".

[INTERPRETERHEAD]
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">

	<link rel="stylesheet" href="interpreter/vorple.min.css">

[]

! [INTERPRETERBODY] provides the part of the page where the window
! or gadget actually appears.

[INTERPRETERBODY]
	<main id="haven">
		<div id="output">
			<div id="window0" aria-live="polite" aria-atomic="false" aria-relevant="additions"></div>
		</div>

		<form id="lineinput">
			<label id="lineinput-prefix" for="lineinput-field">#</label><input name="lineinput" id="lineinput-field" type="text" autocapitalize="none">
		</form>

		<div id="loader">
			<h2 id="loader-message">Loading scripts</h2>
			<div id="spinner">V</div>
		</div>
	</main>

    <script src="interpreter/jquery.min.js"></script>
    <script src="interpreter/toastr.min.js"></script>
	<script src="interpreter/vex.combined.min.js"></script>
	<script src="interpreter/jquery.powertip.min.js"></script>
    <script src="interpreter/haven.min.js"></script>
    <script src="interpreter/vorple.min.js"></script>

    <script>
    	if( location.protocol === "file:" ) {
    		$( 'body' )
    			.empty()
    			.html( "<div><p>You are currently viewing the page from the filesystem. " +
    				"Unfortunately Vorple requires that the page is viewed through " +
    				"the HTTP protocol, that is, you'll need to either upload it " +
    				"to the Internet or install a local server.</p>" +
    				'<p>See <a href="http://vorple-if.com/doc/localhost" style="color:#dde">vorple-if.com/doc/localhost</a> ' +
    				"for more information.</p>" +
    				"</div>" )
    			.find( 'div' )
    			.css({
                    margin: "2em",
                    padding: "1em",
                    color: "#fff",
                    backgroundColor: "rgb(137, 50, 58)",
                    border: "3px solid gray"
    			});

    		throw new Error( "Vorple can't be run from the filesystem" );
    	}

		$( function() {
			$( '#haven' ).prependTo( 'body' );
			$( '.container, .interpretercredit' ).remove();
		});

		Module.locateFile = function( name ) {
			return "interpreter/" + name;
		};

        vorple.options = {
        	autosave: false,
        	engineColors: false,

            // URL to the game file
            story: "[STORYFILE]"
        };

        vorple.debug.off();

        vorple.init();
    </script>

    <script src="interpreter/git.js" defer></script>
[]

! The following footnote is added to the small print about how to play IF
! on the game's main page:

[INBROWSERPLAY]
Or you can play without downloading anything by following the 'Play In-Browser'
link, using the [INTERPRETER] interpreter. You'll need to have Javascript enabled
on your web browser.
[]

! cBlorb encodes the story file into base64 so that it can be loaded in
! Javascript despite being binary data. The encoding is topped and tailed
! with the following, in order to make the result a valid Javascript function
! call with a string argument:

[BASESIXTYFOURTOP]
processBase64Zcode('
[]

[BASESIXTYFOURTAIL]
')
[]

! Outside of the placeholder parts of the manifest, lines beginning '!', or
! lines which contain only white space, are thrown away; so this is a comment.

! Non-comment lines are the names of files which are copied across when the
! release is made. Anything not listed here won't be copied.

vorple.min.js
haven.min.js
jquery.min.js
toastr.min.js
vex.combined.min.js
jquery.powertip.min.js
vorple.min.css
git.js
git.js.mem
Roboto-Bold.eot
Roboto-Bold.ttf
Roboto-Bold.woff
Roboto-Bold.woff2
Roboto-Light.eot
Roboto-Light.ttf
Roboto-Light.woff
Roboto-Light.woff2
Roboto-Medium.eot
Roboto-Medium.ttf
Roboto-Medium.woff
Roboto-Medium.woff2
Roboto-Regular.eot
Roboto-Regular.ttf
Roboto-Regular.woff
Roboto-Regular.woff2
Roboto-Thin.eot
Roboto-Thin.ttf
Roboto-Thin.woff
Roboto-Thin.woff2